  <div class="content">
    <h2 class="title">商品搜索</h2>
    <%= render :partial=>"/admin/admin_products/search" , :locals=>{:url =>admin_admin_products_path} %>
    <div class="inner">
      
      <table class="table">
        <tbody><tr>
            <th class="first">图片</th>
            <th>种类</th>
            <th>颜色</th>
            <th>价格</th>
            <th>等级</th>
            <th>编号</th>
            <th>证书编号</th>
            <th>用户</th>
            <th > </th>
          </tr>
          <% @products.each do |product| %>
            <tr class="<%= cycle("even", "odd")%>">
              <td><%= link_to image_tag(product.try(:product_images).try(:first).try(:image).try(:url).to_s   ,:size=>"120x90") , product_path(product)%></td>
              <td><%= product.sort.name %> </td>
              <td><%= product.color.name %></td>
              <td><%= product.price %></td>
              <td><%=h Product::RANK[product.rank] %></td>
              <td><%= product.serial %></td>
              <td><%= product.proved_serial %></td>
              <td><%= product.user.name %></td>
              <td class="last"><%= link_to '详细', admin_product_path(product) %>|
                <%= link_to '编辑', edit_admin_product_path(product) %>|
                <%= link_to '删除', admin_product_path(product), :confirm => 'Are you sure?', :method => :delete %></td>
            </tr>
          <%end%>
      </tbody></table>
      <%= will_paginate @products  %>
    </div>
  </div>                               


